package net.comm.check.db;


import java.sql.ResultSet;
import java.sql.SQLException;


import net.comm.check.bean.BaseChecklog;
import net.comm.param.bean.BaseProperty;
import net.comm.util.StringUtil;

import org.apache.log4j.Logger;
import org.sakaiproject.db.api.SqlReader;

public class DbChecklogService implements SqlReader
{

	static Logger logger = Logger.getLogger(DbChecklogService.class.getName());

	/**
	 * Read from the result one set of fields to create a Resource.
	 * 
	 * @param result
	 *        The Sql query result.
	 * @return The Resource object.
	 */
	public Object readSqlResultRecord(ResultSet result)
	{
		try
		{
			
			int		seqID = result.getInt(1);			//
			String  checkerType = StringUtil.getValue(result.getString(2));//	验证者类型
			int  	checkerID = result.getInt(3);		//	验证者ID
			int  	checkerLevel = result.getInt(4);	//	验证者等级
			int  	userID = result.getInt(5);		//	被验证会员ID
			int  	userLevel = result.getInt(6);			//	会员等级
			String  mtime = StringUtil.getValue(result.getString(7));		//	验证时间

			// create the Resource from these fields
			return new BaseChecklog(  seqID,  checkerType,  checkerID, checkerLevel,  
					userID,  userLevel,  mtime);
		}
		catch (SQLException e)
		{
			logger.error("读取表数据持久层失败！");
			return null;
		}
		
	}
}
